package com.lianwei.hospital.Service.Impl;

import com.lianwei.hospital.Service.BedService;
import com.lianwei.hospital.mapper.BedInfoMapper;
import com.lianwei.hospital.module.entity.BedInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("BedService")
public class BedInfoImpl implements BedService {
    @Autowired
    BedInfoMapper bedInfoMapper;

    @Override
    public BedInfo selectByPrimaryKey(Integer id) throws Exception {
        return bedInfoMapper.selectByPrimaryKey(id);
    }

    @Override
    public boolean insert(BedInfo bedInfo) throws Exception {
        return bedInfoMapper.insert(bedInfo)>0;
    }

    @Override
    public List<BedInfo> selectAll() throws Exception {
        return bedInfoMapper.selectAll();
    }

    @Override
    public boolean deleteByPrimaryKey(Integer id) throws Exception {
        return bedInfoMapper.deleteByPrimaryKey(id)>0;
    }

    @Override
    public boolean updateByPrimaryKey(BedInfo bedInfo) throws Exception {
        return bedInfoMapper.updateByPrimaryKey(bedInfo)>0;
    }
}
